//
//  SWPageSyncUpdater.swift
//  YiyaPuzzleDemo
//  页面同步更新器
//  Created by linhan on 16/10/11.
//  Copyright © 2016年 test. All rights reserved.
//

import Foundation
class SWPageSyncUpdater: NSObject
{
    var completeCallback:(()->Void)?
    var failCallback:(()->Void)?
    
    private var task:SWUploadTask
    
    init(task:SWUploadTask)
    {
        self.task = task
        super.init()
        
        
    }
    
    func uploadAndUpdate()
    {
        let delay = Double(Math.random(3..<8))
        setTimeout(delay, closure: {[weak self] in
            self?.task.finished = true
            self?.completeCallback?()
        })
    }
    
    //取消上传更新
    func cancel()
    {
        
    }
    
    
    
    
}
